<!DOCTYPE html>
<html>
<head th:include="common/header_css::header('霸王餐小程序后台管理-商品信息','%mfile%datepicker')"></head>
<!--<head th:include="common/header_css::header('霸王餐小程序后台管理-砍价')"></head>-->
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div th:replace="common/toolbar::toolbar('发起砍价活动管理')"></div>
        <div th:replace="common/search::search('no')"></div>
    <!-- End Panel Basic -->
</div>

<!--添加CutpriceOpen模态框-->
<div id="modal-add-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">发起砍价活动添加</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="aform" method="post" class="form-horizontal" action="add"
                                      onsubmit="return checkAdd()">

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">砍价活动id</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="cid"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品id *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="gid"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品名 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="gname"
                                                           required
                                                           type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>


                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">参与砍价人数 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="number"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">最低价</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="minprice"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">原价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="price"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">当前价格 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="curprice"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">总砍价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="totalcutPrice"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">业务状态 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="status">
                                                        <option value="1">未开始</option>
                                                        <option value="2">进行中</option>
                                                        <option value="3">砍价成功</option>
                                                        <option value="4">砍价失败</option>
                                                        <option value="5">活动结束</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否启用 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="state" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">开始时间
                                                    *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="date" class="form-control selectData" readonly
                                                           id="starttime" name="starttime">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">结束时间
                                                    *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="date" class="form-control selectData" readonly
                                                           id="endtime" name="endtime">
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">商品图 *
                                                </label>
                                                <div class="col-sm-10">
                                                    <input id="mfile" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-add-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic" name="pic" type="hidden" value=""
                                           required="required"/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--修改CutpriceOpen模态框-->
<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">发起砍价活动修改</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="mform" method="post" class="form-horizontal" action="modify"
                                      onsubmit="return checkModify()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">砍价活动id</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="cid" name="cid"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品id *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="gid" name="gid"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品名 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="gname" name="gname"
                                                           required
                                                           type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">参与砍价人数 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="number" name="number"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">最低价</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="minprice" name="minprice"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">原价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="price" name="price"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">当前价格 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="curprice" name="curprice"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">总砍价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="totalcutPrice" name="totalcutPrice"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">业务状态 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="status" id="status">
                                                        <option value="1">未开始</option>
                                                        <option value="2">进行中</option>
                                                        <option value="3">砍价成功</option>
                                                        <option value="4">砍价失败</option>
                                                        <option value="5">活动结束</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否启用 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="state" name="state" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">开始时间 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="text" class="form-control selectData" readonly
                                                           id="starttime2" name="starttime">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">结束时间 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="text" class="form-control selectData" readonly
                                                           id="endtime2" name="endtime">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">发起砍价活动人id *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="uid" name="uid"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">商品图 *
                                                </label>
                                                <div class="col-sm-10">
                                                    <img id="previewPic" src='' class='file-preview-image' alt=''
                                                         title=''
                                                         style="width: 100px;height: 100px;"/>
                                                    <input id="mfile2" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic2" name="pic" type="hidden" value=""
                                           required="required"/>
                                    <input id="id" name="id" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

    <div th:include="common/footer_js::footer"></div>
<script src="/js/admin/cutpriceopen.js"></script>
</body>
</html>
